<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>内容列表</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<!-- load css -->
	<link rel="stylesheet" type="text/css" href="__ADMIN__/cache/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="__ADMIN__/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="__ADMIN__/css/adminstyle.css" media="all">
</head>
<body>
<div id="main" class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
	<div class="layui-tab-content">
		<div class="layui-tab-item layui-show">
			<a href="/admin/Content/add/cateid/{$cateid}/modelid/{$modelid}" target="_blank"><div class="layui-btn layui-btn-radius">发布新内容</div></a>
			 <table class="layui-table">
					<colgroup>
						<col width="80">
						<col width="350">
						<col width="100">
						<col width="200">
						<col width="200">
						<col>
					</colgroup>
					<thead>
						<tr>
							<th style="text-align: center;">ID</th>
							<th style="text-align: center;">标题</th>
							<th style="text-align: center;">点击量</th>
							<th style="text-align: center;">发布时间</th>
							<th style="text-align: center;">更新时间</th>
							<th style="text-align: center;">操作</th>
						</tr>
					</thead>
					<tbody>
						<volist name="list" id="mfiles">
						<tr>
							<td style="text-align: center;">{$mfiles['id']}</td>
							<td>
								<a href="{$mfiles['url']}" target="_blank">
									<if condition="$mfiles['thumb'] neq ''"><font color="red">[图]</font></if>
									<foreach name="mfiles['push']" item="vo">
										<switch name="vo">
										    <case value="1"><font color="blue">[推]</font></case>
										    <case value="2"><font color="green">[头]</font></case>
										    <case value="3"><font color="purple">[幻]</font></case>
										    <default />
										</switch>
									</foreach>
									{$mfiles['title']}
								</a>
							</td>
							<td style="text-align: center;">{$mfiles['hits']}</td>
							<td align="center">{$mfiles['addtime']|date="Y-m-d H:i:s",###}</td>
							<td align="center">{$mfiles['updatetime']|date="Y-m-d H:i:s",###}</td>
							<td align="center">
									<a onclick="openurl('{$tablename}','{$mfiles['id']}')" class="layui-btn layui-btn-small layui-btn-normal">移动</a>
									<a href="/admin/content/edit/tablename/{$tablename}/id/{$mfiles['id']}" class="layui-btn layui-btn-small layui-btn-danger" target="_blank">编辑</a>
									<a href="/admin/content/del/tablename/{$tablename}/id/{$mfiles['id']}" class="layui-btn layui-btn-small">删除</a>
							</td>
						</tr>
						</volist>
					</tbody>
				</table>
				<div id="page" style="margin-left: 30%;"></div>
		</div>
	</div>
</div>
<script src="__ADMIN__/layui/jquery-1.8.3.min.js" charset="utf-8"></script>
<script src="__ADMIN__/cache/layui.js" charset="utf-8"></script>
<script type="text/javascript">
	layui.use(['laypage','layer','form'], function(){
		var layer = layui.layer,
		laypage = layui.laypage,
		form = layui.form();
		laypage({
			cont: 'page'
			,pages: {$pages}
			,skip: true
			,skin: '#c00'
			,curr: {$page}
			,jump: function(obj, first){
					//得到了当前页，用于向服务端请求对应数据
					var newurl=location.href.replace('?page='+{$page},'')+'?page='+obj.curr;
					if (obj.curr!={$page}) {
						window.location.href=newurl;
					}
				}
		});
	});
	function openurl(tablename,id){
	 layer.open({
		type: 2
		,title: '内容转移'
		,area: ['300px', '489px']
		,shade: 0
		,maxmin: true
		,content: '/admin/content/move/tablename/'+tablename+'/id/'+id
		,end: function(index, layero){
			location.reload();
		}
	});
}
</script>
</body>
</html>